import React from "react";

function DragPreview({ onDrop, children, accept, onSwap }) {
  const _onDrop = (e) => {
    let endId = "";
    if (e?.target?.dataset?.id) {
      endId = e?.target?.dataset?.id;
    } else {
      endId = e?.target?.parentNode?.dataset?.id;
    }
    onDrop && onDrop(endId);
  };
  const _onDragOver = (e) => {
    e.preventDefault();
  };
  return (
    <div
      style={{ overflowX: "hidden", height: "100%", width: "375px" }}
      onDragOver={_onDragOver}
      onDrop={_onDrop}
    >
      {children}
    </div>
  );
}
export default DragPreview;
